From 7d166e1f5a4958eb062e8542e3a4881496bfee47 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Thu, 17 May 2007 08:27:08 +0000 Subject: [PATCH] (ispell-start-process): Defend against bad default-directory. --- lisp/textmodes/ispell.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index a3c9575d90c..e4b2dd9f040 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -2483,7 +2483,12 @@ When asynchronous processes are not supported, `run' is always returned." (defun ispell-start-process () "Start the ispell process, with support for no asynchronous processes. Keeps argument list for future ispell invocations for no async support." - (let (args) + (let ((default-directory default-directory) + args) + (unless (and (file-directory-p default-directory) + (file-readable-p default-directory)) + ;; Defend against bad `default-directory'. + (setq default-directory (expand-file-name "~/"))) ;; Local dictionary becomes the global dictionary in use. (setq ispell-current-dictionary (or ispell-local-dictionary ispell-dictionary)) -- 2.30.2